"""
ComfyUI Reve API Integration Node

This package provides a unified ComfyUI custom node for integrating with the Reve API,
supporting Create, Edit, and Remix operations in a single dynamic node.
"""

import os
import sys

# Add current directory to path for imports
current_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, current_dir)

try:
    from .nodes.reve_api_node import ReveAPI
    
    # Node class mappings for ComfyUI
    NODE_CLASS_MAPPINGS = {
        "ReveAPI": ReveAPI
    }
    
    # Display name mappings for ComfyUI interface
    NODE_DISPLAY_NAME_MAPPINGS = {
        "ReveAPI": "Reve API (Create/Edit/Remix)"
    }
    
    # Web directory for any custom UI components (if needed in future)
    WEB_DIRECTORY = "./web"
    
    print("✅ ComfyUI Reve API Integration loaded successfully")
    
except ImportError as e:
    print(f"❌ Failed to load ComfyUI Reve API Integration: {e}")
    print("Please ensure all dependencies are installed:")
    print("  pip install requests pillow")
    
    # Create empty mappings to prevent ComfyUI errors
    NODE_CLASS_MAPPINGS = {}
    NODE_DISPLAY_NAME_MAPPINGS = {}

except Exception as e:
    print(f"❌ Unexpected error loading ComfyUI Reve API Integration: {e}")
    NODE_CLASS_MAPPINGS = {}
    NODE_DISPLAY_NAME_MAPPINGS = {}

# Export for ComfyUI
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]
